Fix KubernetesPodOperator 404 on pod preemption#69062
Open
ambika-garg wants to merge 1 commit into
Open
Conversation
Contributor
Author
|
Hi @jscheffl, could you please review my PR when you get a chance? Once you approve the code changes, I'll update the test classes accordingly. |
Contributor
|
Quickest fix: git fetch upstream main && git rebase upstream/main
rm uv.lock && uv lock
git add uv.lock && git rebase --continue
git push --force-with-leaseAutomated nudge — ignore if you're not ready to rebase. This comment is updated in place on future |
9f6fd84 to
4f930ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Key changes:
PodManager.read_pod): Retries 404s up to 3 times with exponential backoff (2s, 4s, 8s). Retries are skipped andPodNotFoundExceptionis raised immediately if the pod was previously observed in aRunningphase (or anything other thanPending).AsyncKubernetesHook.get_pod): Modified to accept an optionalpodargument to inspect the pod's last known state, applying the exact same exponential backoff and phase-based safeguards.KubernetesPodTrigger): Updated the trigger to trackself.last_podduring its polling loop and pass it down toAsyncKubernetesHook.get_podto persist state across the stateless hook calls.test_pod_manager.pyandtest_kubernetes.py.In case of an existing issue, reference it using one of the following:
closes: #59626
Was generative AI tooling used to co-author this PR?
{pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.